﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using Model;

namespace BLL
{
    public class FoodManager
    {
        public static List<Food> SelectByClassID(int classid)
        {
            return FoodService.SelectAllByClassID(classid);
        }
        public static List<Food> SelectFoods(string name)
        {
            return FoodService.SelectFood(name);
        }
        public static List<Food> SelectFoodbyid(int id)
        {
            return FoodService.SelectByID(id);
        }
        public static List<Food> FoodSelectbyPage(int count, int pageIndex) {
            return FoodService.SelectFoodByPage(count, pageIndex);
        }
        public static List<Food> FoodSelectAll()
        {
            return FoodService.SelectAll();
        }
        public static Food SelectPricebyid(int id)
        {
            return FoodService.SelectPrice(id);
        }
        public static bool InsertFood(Food f)
        {
            return FoodService.Insert(f);
        }
        public static List<Food> SelectAllFood()
        {
            return FoodService.SelectAll();
        }
        public static List<Food> ProductSelectByPage(int count, int pageIndex)//分页查
        {
            return FoodService.SelectByPage(count, pageIndex);
        }
        public static List<FoodType> SelectAllProductClass()
        {
            return FoodService.SelectAllty();
        }
        public static List<Food> SelectAllProductByClassIDd(int Typeid)
        {
            return FoodService.SelectAllByClassIDd(Typeid);
        }
        public static bool DeleteFood(int Foodid)
        {
            return FoodService.Delete(Foodid);
        }
        public static Food SelectByIDFood(int Foodid)
        {
            return FoodService.SelectByp(Foodid);
        }
        public static bool UpdateFood(Food f)
        {
            return FoodService.Update(f);
        }
    }
}
